// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "WorldEntityPart.h"
#include "WorldRoadObjectParkingSpaceAccess.h"
#include "WorldRoadObjectParkingSpaceMarkingSide.h"
#include "WorldRoadMarkKind.h"
#include "WorldRoadMarkColor.h"

/**
 * An entity of a road/objects/object/parkingSpace/marking
 */
class FWorldRoadObjectParkingSpaceMarking : public FWorldEntityPart
{

public:

	using Ptr = std::shared_ptr<FWorldRoadObjectParkingSpaceMarking>;
	using Super = FWorldEntityPart;

	FWorldEntityProperty< FWorldRoadObjectParkingSpaceMarkingSide >	Side;
	FWorldEntityProperty< FWorldRoadMarkKind >						Type;
	FWorldEntityProperty< double >									Width;
	FWorldEntityProperty< FWorldRoadMarkColor >						Color;

public:

	FWorldRoadObjectParkingSpaceMarking();
	FWorldRoadObjectParkingSpaceMarking(FWorldEntityPart* parent, const pugi::xml_node& elem);
	~FWorldRoadObjectParkingSpaceMarking() override;

	WORLD_ENTITY_META_DECLARE(FWorldRoadObjectParkingSpaceMarking)

};

/**
 * An entity of a road/objects/object/parkingSpace
 */
class FWorldRoadObjectParkingSpace : public FWorldEntityPart
{

public:

	using Ptr = std::shared_ptr<FWorldRoadObjectParkingSpace>;
	using Super = FWorldEntityPart;

	FWorldEntityProperty< FWorldRoadObjectParkingSpaceAccess >					Access;
	FWorldEntityProperty< std::string >											Restrictions;
	FWorldEntityPartArrayReference< FWorldRoadObjectParkingSpaceMarking, 0, 4>	Marking;

public:

	FWorldRoadObjectParkingSpace();
	FWorldRoadObjectParkingSpace(FWorldEntityPart* parent, const pugi::xml_node& elem);
	~FWorldRoadObjectParkingSpace() override;

	void Resolve(FWorldEntityReferencing& referencing) override;

	WORLD_ENTITY_META_DECLARE(FWorldRoadObjectParkingSpace)

};

/**
 * An entity of a road/objects/object/material
 */
class FWorldRoadObjectMaterial : public FWorldEntityPart
{

public:

	using Ptr = std::shared_ptr<FWorldRoadObjectMaterial>;
	using Super = FWorldEntityPart;

	FWorldEntityProperty< std::string >	Surface;
	FWorldEntityProperty< double >		Friction;
	FWorldEntityProperty< double >		Roughness;

public:

	FWorldRoadObjectMaterial();
	FWorldRoadObjectMaterial(FWorldEntityPart* parent, const pugi::xml_node& elem);
	~FWorldRoadObjectMaterial() override;

	WORLD_ENTITY_META_DECLARE(FWorldRoadObjectMaterial)

};

/**
 * An entity of a road/objects/object/outline/cornerLocal
 */
class FWorldRoadObjectCornerLocal : public FWorldEntityPart
{

public:

	using Ptr = std::shared_ptr<FWorldRoadObjectCornerLocal>;
	using Super = FWorldEntityPart;

	FWorldEntityProperty< double >	U;
	FWorldEntityProperty< double >	V;
	FWorldEntityProperty< double >	Z;
	FWorldEntityProperty< double >	Height;

public:

	FWorldRoadObjectCornerLocal();
	FWorldRoadObjectCornerLocal(FWorldEntityPart* parent, const pugi::xml_node& elem);
	~FWorldRoadObjectCornerLocal() override;

	WORLD_ENTITY_META_DECLARE(FWorldRoadObjectCornerLocal)

};

/**
 * An entity of a road/objects/object/outline/cornerRoad
 */
class FWorldRoadObjectCornerRoad : public FWorldEntityPart
{

public:

	using Ptr = std::shared_ptr<FWorldRoadObjectCornerRoad>;
	using Super = FWorldEntityPart;

	FWorldEntityProperty< double >	S;
	FWorldEntityProperty< double >	T;
	FWorldEntityProperty< double >	Dz;
	FWorldEntityProperty< double >	Height;

public:

	FWorldRoadObjectCornerRoad();
	FWorldRoadObjectCornerRoad(FWorldEntityPart* parent, const pugi::xml_node& elem);
	~FWorldRoadObjectCornerRoad() override;

	WORLD_ENTITY_META_DECLARE(FWorldRoadObjectCornerRoad)

};

/**
 * An entity of a road/objects/object/outline
 */
class FWorldRoadObjectOutline : public FWorldEntityPart
{

public:

	using Ptr = std::shared_ptr<FWorldRoadObjectOutline>;
	using Super = FWorldEntityPart;

	FWorldEntityPartArrayReference< FWorldRoadObjectCornerRoad, 0, INT_MAX >	CornerRoad;
	FWorldEntityPartArrayReference< FWorldRoadObjectCornerLocal, 0, INT_MAX >	CornerLocal;

public:

	FWorldRoadObjectOutline();
	FWorldRoadObjectOutline(FWorldEntityPart* parent, const pugi::xml_node& elem);
	~FWorldRoadObjectOutline() override;

	void Resolve(FWorldEntityReferencing& referencing) override;

	WORLD_ENTITY_META_DECLARE(FWorldRoadObjectOutline)

};

/**
 * An entity of a road/objects/object/repeat
 */
class FWorldRoadObjectRepeat : public FWorldEntityPart
{

public:

	using Ptr = std::shared_ptr<FWorldRoadObjectRepeat>;
	using Super = FWorldEntityPart;

	FWorldEntityProperty< double >	S;
	FWorldEntityProperty< double >	Length;
	FWorldEntityProperty< double >	Distance;
	FWorldEntityProperty< double >	TStart;
	FWorldEntityProperty< double >	TEnd;
	FWorldEntityProperty< double >	WidthStart;
	FWorldEntityProperty< double >	WidthEnd;
	FWorldEntityProperty< double >	HeightStart;
	FWorldEntityProperty< double >	HeightEnd;
	FWorldEntityProperty< double >	ZOffsetStart;
	FWorldEntityProperty< double >	ZOffsetEnd;

public:

	FWorldRoadObjectRepeat();
	FWorldRoadObjectRepeat(FWorldEntityPart* parent, const pugi::xml_node& elem);
	~FWorldRoadObjectRepeat() override;

	WORLD_ENTITY_META_DECLARE(FWorldRoadObjectRepeat)

};
